<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="翻译平台、翻译网站、找翻译、找人翻译、法语翻译、英语翻译、日语翻译、德语翻译、意大利语翻译、俄罗斯语、翻译人员、成都翻译、成都翻译员" />
<meta name="description" content="众译，助推翻译事业，选择最佳翻译人员，最迅速、最便捷的网络翻译平台。" />
<title>众译-可信赖的翻译平台-项目搜索结果</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/reset.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/css.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/jquery.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/config.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/industry.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/chooselanguage.js"></script>
<script type="text/javascript">
	$(function(){
		initLanguage("langTo", ''+$("input:hidden[name='v_langTo']").val());
		initLanguage("langFrom", ''+$("input:hidden[name='v_langFrom']").val());
		initIndustry('area', ''+$("input:hidden[name='v_area']").val());
		initType("goodAtType", ''+$("input:hidden[name='v_goodAt']").val());
		storeSearch();
		replaceLanguage();
		$("#confirm_to_page").bind("click", topageClick);
		$(".search_btn").bind('click', seachHandler);
	});
	
	function seachHandler() {
		$("#page").val(1);
		search();
	}
	
	function storeSearch() {
		var v_st = $("input:hidden[name='v_status']").val();
		var v_pl = $("input:hidden[name='v_publish']").val();
		$("select[name='status']").val(v_st);
		$("select[name='publish']").val(v_pl);
	}
	
	function topageClick(event) {
		var page = $("#to_page").val();
		
		try {
			page = parseInt(page);
		} catch (e) {
			page = 0;
		}
		
		if (isNaN(page) || page <= 0) {
			return;
		}
		
		topage(page);
	}
	
	function replaceLanguage() {
		$(".lang_txt").each(function (index){
			var lang_id = $(this).text().split(",");
			var txt = new Array();
			for (var i = 0 ; i < lang_id.length; i++) {
				txt.push(getTranslate(lang_id[i]));
			}
			$(this).text(txt.join(","));
		});
	}
	
	function go(dir) {
		try {
			dir = parseInt(dir, 10);
			var page = $("#page").val();
			page = parseInt(page, 10);
			if (dir > -1) {
				page = page + 1;
			} else {
				page = page - 1;
			}
			if (page <= 0) {
				page = 1;
			}
			topage(page);
		} catch (e) {
			// 
		}
	}
	
	function topage(page) {
		$("#page").val(page);
		search();
	}
	
	function search() {
		$("#search_form").submit();
	}
</script>
</head>
<body>
<div class="layout">
<jsp:include page="/include/head/top.jsp" /> 
<jsp:include page="/include/head/top_nav.jsp" />
<div class="content">
<div class="col_left">
	<div class="search_if">
	<form action="<%=request.getContextPath() %>/search/project_search" enctype="application/x-www-form-urlencoded" method="post" id="search_form">
	    <table class="table_data bgee">
	  <tbody><tr>
	    <td width="100" align="right">语言方向：</td>
	    <td>
	    	<select name="langFrom" id="langFrom">
				<option value="">请选择源语言</option>
			</select>
			»
			<select name="langTo" id="langTo">
				<option value="">请选择目标语言</option>
			</select>
	    </td>
	  </tr>
	  <tr>
	    <td align="right">专业领域：</td>
	    <td><select name="area" id="area" style="width:100px;padding:2px;"></select></td>
	  </tr>
	  <tr>
	    <td align="right">类型：</td>
	    <td id="goodAtType"></td>
	  </tr>
	  <tr>
	    <td align="right">状态：</td>
	    <td>
	    	<select name="status">
		    	<option value="<s:property value="@com.transer.constant.Constants@PROJECT_STATUS_START"/>">正在竞标</option>
		    	<option value="<s:property value="@com.transer.constant.Constants@PROJECT_STATUS_END"/>">竞标结束</option>
		    	<option value="<s:property value="@com.transer.constant.Constants@PROJECT_STATUS_WORKING"/>">工作进行中</option>
		    	<option value="<s:property value="@com.transer.constant.Constants@PROJECT_STATUS_FINISH"/>">项目完工</option>
	    	</select>&nbsp;&nbsp;
	    	发布时间：
	    	<select name="publish">
		    	<option value="0">不限</option>
		    	<option value="1">1天</option>
		    	<option value="3">3天</option>
		    	<option value="7">7天</option>
		    	<option value="15">15天</option>
		    	<option value="30">30天</option>
		    	<option value="60">60天</option>
		    	<option value="90">90天</option>
	    	</select>
	    </td>
	  </tr>
	    <tr>
	    <td align="right"></td>
	    <td>
	    	<input type="button" class="search_btn" value=""/>
			<input type="hidden" value="<s:property value='searchTxt'/>" name="searchTxt" id="searchTxt"/>
			<input name="page" id="page" type="hidden" value="<s:property value='page'/>"/>
		</td>
	  </tr>
	</tbody>
	</table>
	</form>
	    </div>
	<table class="trlist">
		<tr>
			<th width="298">翻译项目种类及描述</th>
			<th width="150">发布日期&amp;竞标结束日期</th>
			<th width="100">外包预算</th>
			<th width="100">竞标人数</th>
		</tr>
		<s:iterator value="projects" var="project">
			<tr>
				<td><span class="lang_txt"><s:property value="#project.langFrom"/></span> -&gt; <span class="lang_txt"><s:property value="#project.langTo"/></span><br />
				<a href="<%=request.getContextPath() %>/search/project/<s:property value='#project.id'/>" target="_blank"><s:property value="#project.title"/></a></td>
				<td align="center">
				<s:text name="global.format.date"><s:param value="#project.start"/></s:text>
				<br />
				<s:set var="day" value="%{#project.leftHours()}"/>
				<s:property value="%{(#day / 24) + '天' + (#day % 24) + '小时'}"/>
				</td>
				<td><b><s:property value="#project.money"/>RMB</b></td>
				<td><s:property value="#project.bidSize"/></td>
			</tr>
		</s:iterator>
	</table>

<div class="page">
<span>
<s:if test="%{page <= 1}">
	<a href="javascript:void(0)" class="disable">上一页</a>
</s:if>
<s:else>
	<a href="javascript:go('-1')">上一页</a>
</s:else>

<s:if test="totalPage < 6">
	<s:iterator var="i" value="{1,2,3,4,5}">
		<s:if test="#i <= totalPage">
			<s:if test="#i == page">
				<b><s:property value="#i"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#i"/>')"><s:property value="#i"/></a>
			</s:else>
		</s:if>
	</s:iterator>
</s:if>
<s:else>
	<s:if test="%{page < 6}">
		<s:iterator var="c_page" value="{1,2,3,4,5}">
			<s:if test="#c_page == page">
				<b><s:property value="#c_page"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#c_page"/>')"><s:property value="#c_page"/></a>
			</s:else>
		</s:iterator>
		<b>......</b>
		<a href="javascript:topage('<s:property value="totalPage"/>')"><s:property value="totalPage"/></a>
	</s:if>
	<s:elseif test="%{page > 5 && totalPage - page > 3}">
		<a href="javascript:topage('1')">1</a>
		<a href="javascript:topage('2')">2</a>
		<b>......</b>
		<s:iterator var="c_page" value="{page - 2, page -1, page, page + 1, page + 2}">
			<s:if test="#c_page == page">
				<b><s:property value="#c_page"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#c_page"/>')"><s:property value="#c_page"/></a>
			</s:else>
		</s:iterator>
		<b>......</b>
		<a href="javascript:topage('<s:property value="totalPage"/>')"><s:property value="totalPage"/></a>
	</s:elseif>
	<s:else>
		<a href="javascript:topage('1')">1</a>
		<a href="javascript:topage('2')">2</a>
		<b>......</b>
		<s:iterator var="c_page" value="{totalPage - 3, totalPage - 2, totalPage - 1, totalPage}">
			<s:if test="#c_page == page">
				<b><s:property value="#c_page"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#c_page"/>')"><s:property value="#c_page"/></a>
			</s:else>
		</s:iterator>
	</s:else>
</s:else>
<s:if test="%{page == 0 || page >= totalPage}">
	<a href="javascript:void(0)" class="disable">下一页</a>
</s:if>
<s:else>
	<a href="javascript:go('1')">下一页</a>
</s:else>
</span>
<span style="font-size:12px;">
共<s:property value="totalPage"/>页 
到第<input type="text" name="to_page" id="to_page" style="width:22px;"/>页 
<input type="button" id="confirm_to_page" name="confirm_to_page" value="确定"/>
</span> 
</div>
<input type="hidden" value="<s:property value='langFrom'/>" name="v_langFrom"/>
<input type="hidden" value="<s:property value='langTo'/>" name="v_langTo"/>
<input type="hidden" value="<s:property value='area'/>" name="v_area"/>
<input type="hidden" value="<s:property value='goodAt'/>" name="v_goodAt"/>
<input type="hidden" value="<s:property value='status'/>" name="v_status"/>
<input type="hidden" value="<s:property value='publish'/>" name="v_publish"/>
</div>
<div class="col_right">
<dl class="category">
	<dt>快速翻译种类</dt>
	<dd><a href="#">英语翻译</a></dd>
	<dd><a href="#">日语翻译</a></dd>
	<dd><a href="#">法语翻译</a></dd>
	<dd><a href="#">德语翻译</a></dd>
	<dd><a href="#">意大利语翻译</a></dd>
	<dd><span><a href="#">更多&gt;&gt;</a></span></dd>
</dl>
</div>
</div>
<jsp:include page="/include/foot/foot.jsp" />
</div>
</body>
</html>